package cn.edu.tju.elm.repository;

import cn.edu.tju.elm.model.RewardRule;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.Optional;

@Repository
public interface RewardRuleRepository extends JpaRepository<RewardRule, Long> {
    
    /**
     * 根据权限名称查找奖励规则
     */
    Optional<RewardRule> findByAuthorityName(String authorityName);
    
    /**
     * 根据权限名称和激活状态查找奖励规则
     */
    Optional<RewardRule> findByAuthorityNameAndIsActiveTrue(String authorityName);
}